package alitaV.old;

import org.apache.commons.lang3.RandomStringUtils;

import java.lang.reflect.Field;

public class Apptest1 {
    public static void main(String[] args) {

    }
    public  static  <X> X genObj(Class<X> s) throws IllegalAccessException {
        X p=null;
        Field[] Fields = s.getDeclaredFields();
        for (Field field:Fields){
        if (s.isAssignableFrom(String.class)){
            field.setAccessible(true);
           p = (X) RandomStringUtils.randomAlphabetic(3);
           field.set(s,p);
        }

    }
return p;}
}
